package com.junhong.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 用户管理
 * 
 * @author User
 *
 */
@Entity
@Table(name = "user")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "userId")
	@GeneratedValue
	private Integer userId; // 用户ID
	@Column(name = "userName", length = 10)
	private String userName; // 用户名
	@Column(name = "password", length = 12)
	private String password; // 密码
	@Column(name = "userType")
	private Integer userType; // 类型
	@Column(name = "userDescription",length = 30)
	private String userDescription;// 描述信息
	@Column(name = "roleName",length = 10)
	private String roleName;// 角色名字

	@ManyToOne
	@JoinColumn(name = "roleidd")
	@JsonIgnore
	private Role roleidd;// 角色ID

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public String getUserDescription() {
		return userDescription;
	}

	public void setUserDescription(String userDescription) {
		this.userDescription = userDescription;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public Role getRoleidd() {
		return roleidd;
	}

	public void setRoleidd(Role roleidd) {
		this.roleidd = roleidd;
	}

	public User(Integer userId, String userName, String password, Integer userType, String userDescription,
			String roleName, Role roleidd) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.password = password;
		this.userType = userType;
		this.userDescription = userDescription;
		this.roleName = roleName;
		this.roleidd = roleidd;
	}

	public User() {
		super();
	}

}
